package zuosheng.string;

/**
 * @author lj
 * @Description: 是否为旋转词
 * @date 2020-11-15 14:16
 * @QQ 851477108
 */


public class Rotation {
    public static void main(String[] args) {
        String a = "12345";
        String b = "45123";
        System.out.println(isRotation(a,b));
    }
    public static boolean isRotation(String a, String b){
        if (a == null || b == null || a.length() != b.length()){
            return false;
        }

        String B = b + b;
        return getIndexOf(B, a) != -1;
    }

    //KMP判断B是否包含a
    public static int getIndexOf(String B, String a){

        return 0;
    }
}
